﻿namespace HuaWei.Windows.Forms
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraNavBar;
    using DevExpress.XtraTab;
    using HuaWei;
    using HuaWei.CBR;
    using HuaWei.CommClass;
    using HuaWei.CommComp;
    using HuaWei.Common;
    using HuaWei.DAI;
    using HuaWei.EI;
    using HuaWei.GLY;
    using HuaWei.Report;
    using HuaWei.Search;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmMain : Form
    {
        private Bar bar;
        private Bar bar1;
        private BarButtonItem barButtonItem;
        private BarButtonItem barButtonItem1;
        private BarDockControl barDockControl;
        private BarDockControl barDockControl1;
        private BarDockControl barDockControl2;
        private BarDockControl barDockControl3;
        private BarDockControl barDockControl4;
        private BarDockControl barDockControl5;
        private BarDockControl barDockControl6;
        private BarDockControl barDockControl7;
        private BarEditItem barEditItem1;
        private BarManager barManager;
        private BarStaticItem barStaticItem1;
        private BarStaticItem barStaticItem2;
        private BarStaticItem barStaticItem3;
        private BarStaticItem barStaticItem4;
        private BarStaticItem barStaticItem5;
        private BarLargeButtonItem btnBBDY;
        private BarLargeButtonItem btnBGL;
        private BarButtonItem btnBGLXD;
        private BarLargeButtonItem btnCTWH;
        private BarButtonItem btnEditQc;
        private BarButtonItem btnExport;
        private BarButtonItem btnJLLR;
        private BarLargeButtonItem btnJLSP;
        private BarLargeButtonItem btnSJWH;
        private BarButtonItem btnUser;
        private DataSet dataSet;
        private DataTable dataTable;
        private BarEditItem edtBD;
        private IContainer icontainer = null;
        private ImageList imageList;
        private ImageList imageList1;
        private BarStaticItem lblJL;
        private BarStaticItem lblYZ;
        private BarManager onypCxUys;
        private RepositoryItemGridLookUpEdit repositoryItemGridLookUpEdit1;
        private GridView repositoryItemGridLookUpEdit1View;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit1;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit2;
        private RepositoryItemPopupContainerEdit repositoryItemPopupContainerEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private RepositoryItemTextEdit repositoryItemTextEdit3;
        private RepositoryItemTextEdit repositoryItemTextEdit4;
        private RepositoryItemTextEdit repositoryItemTextEdit5;
        private RepositoryItemTextEdit repositoryItemTextEdit6;
        private RepositoryItemTextEdit repositoryItemTextEdit7;
        private RepositoryItemTextEdit repositoryItemTextEdit8;
        private XtraTabControl tabControl;
        private XtraTabPage tpBBDY;
        private XtraTabPage tpBGL;
        private XtraTabPage tpCTWH;
        private XtraTabPage tpJLLR;
        private XtraTabPage tpJLSP;
        private XtraTabPage tpSJWH;
        private XtraTabPage tpZHCX;
        private IContainer components;
        private BarButtonItem ylcQheaGue;

        public FrmMain()
        {
            this.InitializeComponent();
            GParams.mainHandle = base.Handle;
            this.tabControl.ShowTabHeader = DefaultBoolean.False;
        }

        private void barButtonItem_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.method16();
        }

        private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.method14();
            this.method15(0x62);
        }

        private void btnBBDY_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.method11(e.Item);
        }

        private void btnBGLXD_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.method16();
            this.method4();
        }

        private void btnExport_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.method16();
            this.method3();
            this.method15(0x63);
        }

        private void btnUser_ItemClick(object sender, ItemClickEventArgs e)
        {
            new FrmYHXX().ShowDialog();
        }

        public Form CreateMainForm()
        {
            return this;
        }

        public bool DataCheck(string fileId, string sid, SJLX sjlx)
        {
            if (SJLX.JG.Equals(sjlx))
            {
                if (!fileId.Equals(GParams._XMID))
                {
                    MsgBox.ShowMsg("请选择本项目的机构数据包后继续此操作!");
                    return false;
                }
            }
            else if (!fileId.Equals(GParams._BDID))
            {
                MsgBox.ShowMsg("请选择本标段的数据包后继续此操作!");
                return false;
            }
            if (sjlx.Equals(SJLX.BGL))
            {
                if (!fileId.Equals(GParams._BDID))
                {
                    MsgBox.ShowMsg("导入的变更令相关数据不是本标段的数据,导入失败!");
                    return false;
                }
            }
            else if (sjlx.Equals(SJLX.JG))
            {
                if (DBHelp.GetDt(string.Format("select id from zzjgxx where xmid='{0}'", fileId), "temp").Rows.Count.Equals(0))
                {
                    MsgBox.ShowMsg("数据无效,导入失败!");
                    return false;
                }
            }
            else if (sjlx.Equals(SJLX.YZSP))
            {
                if (DBHelp.GetDt(string.Format("select id from zzjgxx where id='{0}' or pid='{0}'", sid), "temp").Rows.Count.Equals(0))
                {
                    MsgBox.ShowMsg("数据无效,导入失败!");
                    return false;
                }
            }
            else
            {
                DataTable dt = DBHelp.GetDt(string.Format("select pid from zzjgxx where id='{0}'", sid), "temp");
                if (dt.Rows.Count.Equals(0))
                {
                    MsgBox.ShowMsg("数据无效,导入失败!");
                    return false;
                }
                if (!GParams.LoginId.Equals(dt.Rows[0][0].ToString()))
                {
                    MsgBox.ShowMsg("接收数据只能接收组织机构中前一个岗位的数据,导入失败!");
                    return false;
                }
            }
            return true;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        private void edtBD_EditValueChanged(object sender, EventArgs e)
        {
            this.method19();
        }

        private void FrmMain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Environment.Exit(Environment.ExitCode);
        }

        private void FrmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            foreach (XtraTabPage page in this.tabControl.TabPages)
            {
                if (page.Controls.Count > 0)
                {
                    for (int i = 0; i < page.Controls.Count; i++)
                    {
                        if (page.Controls[i] is Form)
                        {
                            (page.Controls[0] as Form).Close();
                        }
                    }
                }
            }
        }

        private void FrmMain_Load(object sender, EventArgs e)
        {
        }

        public void IniLogin()
        {
            this.method13();
            this.method9();
            this.method12();
        }

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.imageList1 = new System.Windows.Forms.ImageList(this.components);
            this.imageList = new System.Windows.Forms.ImageList(this.components);
            this.barManager = new DevExpress.XtraBars.BarManager(this.components);
            this.bar1 = new DevExpress.XtraBars.Bar();
            this.ylcQheaGue = new DevExpress.XtraBars.BarButtonItem();
            this.btnJLLR = new DevExpress.XtraBars.BarButtonItem();
            this.btnJLSP = new DevExpress.XtraBars.BarLargeButtonItem();
            this.btnBGL = new DevExpress.XtraBars.BarLargeButtonItem();
            this.btnSJWH = new DevExpress.XtraBars.BarLargeButtonItem();
            this.btnCTWH = new DevExpress.XtraBars.BarLargeButtonItem();
            this.btnBBDY = new DevExpress.XtraBars.BarLargeButtonItem();
            this.barStaticItem1 = new DevExpress.XtraBars.BarStaticItem();
            this.edtBD = new DevExpress.XtraBars.BarEditItem();
            this.repositoryItemLookUpEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
            this.barButtonItem = new DevExpress.XtraBars.BarButtonItem();
            this.btnUser = new DevExpress.XtraBars.BarButtonItem();
            this.barButtonItem1 = new DevExpress.XtraBars.BarButtonItem();
            this.barStaticItem5 = new DevExpress.XtraBars.BarStaticItem();
            this.barDockControl = new DevExpress.XtraBars.BarDockControl();
            this.barDockControl1 = new DevExpress.XtraBars.BarDockControl();
            this.barDockControl2 = new DevExpress.XtraBars.BarDockControl();
            this.barDockControl3 = new DevExpress.XtraBars.BarDockControl();
            this.barEditItem1 = new DevExpress.XtraBars.BarEditItem();
            this.repositoryItemTextEdit5 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.btnExport = new DevExpress.XtraBars.BarButtonItem();
            this.btnBGLXD = new DevExpress.XtraBars.BarButtonItem();
            this.barStaticItem4 = new DevExpress.XtraBars.BarStaticItem();
            this.btnEditQc = new DevExpress.XtraBars.BarButtonItem();
            this.repositoryItemTextEdit4 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.repositoryItemTextEdit6 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.repositoryItemPopupContainerEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemPopupContainerEdit();
            this.repositoryItemGridLookUpEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit();
            this.repositoryItemGridLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.tpJLLR = new DevExpress.XtraTab.XtraTabPage();
            this.tpZHCX = new DevExpress.XtraTab.XtraTabPage();
            this.tabControl = new DevExpress.XtraTab.XtraTabControl();
            this.tpCTWH = new DevExpress.XtraTab.XtraTabPage();
            this.tpJLSP = new DevExpress.XtraTab.XtraTabPage();
            this.tpBGL = new DevExpress.XtraTab.XtraTabPage();
            this.tpSJWH = new DevExpress.XtraTab.XtraTabPage();
            this.tpBBDY = new DevExpress.XtraTab.XtraTabPage();
            this.onypCxUys = new DevExpress.XtraBars.BarManager(this.components);
            this.bar = new DevExpress.XtraBars.Bar();
            this.barStaticItem2 = new DevExpress.XtraBars.BarStaticItem();
            this.lblYZ = new DevExpress.XtraBars.BarStaticItem();
            this.barStaticItem3 = new DevExpress.XtraBars.BarStaticItem();
            this.lblJL = new DevExpress.XtraBars.BarStaticItem();
            this.barDockControl7 = new DevExpress.XtraBars.BarDockControl();
            this.barDockControl6 = new DevExpress.XtraBars.BarDockControl();
            this.barDockControl4 = new DevExpress.XtraBars.BarDockControl();
            this.barDockControl5 = new DevExpress.XtraBars.BarDockControl();
            this.repositoryItemTextEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.repositoryItemTextEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.repositoryItemTextEdit3 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.repositoryItemLookUpEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit();
            this.repositoryItemTextEdit7 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.repositoryItemTextEdit8 = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            this.dataSet = new System.Data.DataSet();
            ((System.ComponentModel.ISupportInitialize)(this.barManager)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemLookUpEdit2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit5)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit4)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit6)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemPopupContainerEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemGridLookUpEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemGridLookUpEdit1View)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.tabControl)).BeginInit();
            this.tabControl.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.onypCxUys)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit3)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemLookUpEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit7)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit8)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet)).BeginInit();
            this.SuspendLayout();
            // 
            // imageList1
            // 
            this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
            this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
            this.imageList1.TransparentColor = System.Drawing.Color.Magenta;
            // 
            // imageList
            // 
            this.imageList.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
            this.imageList.ImageSize = new System.Drawing.Size(16, 16);
            this.imageList.TransparentColor = System.Drawing.Color.Transparent;
            // 
            // barManager
            // 
            this.barManager.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
            this.bar1});
            this.barManager.DockControls.Add(this.barDockControl);
            this.barManager.DockControls.Add(this.barDockControl1);
            this.barManager.DockControls.Add(this.barDockControl2);
            this.barManager.DockControls.Add(this.barDockControl3);
            this.barManager.Form = this;
            this.barManager.Images = this.imageList1;
            this.barManager.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
            this.barEditItem1,
            this.btnExport,
            this.barButtonItem,
            this.btnBGLXD,
            this.btnUser,
            this.barStaticItem1,
            this.edtBD,
            this.barButtonItem1,
            this.barStaticItem4,
            this.barStaticItem5,
            this.btnEditQc,
            this.ylcQheaGue,
            this.btnJLLR,
            this.btnJLSP,
            this.btnBGL,
            this.btnSJWH,
            this.btnCTWH,
            this.btnBBDY});
            this.barManager.MainMenu = this.bar1;
            this.barManager.MaxItemId = 24;
            this.barManager.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemTextEdit5,
            this.repositoryItemTextEdit4,
            this.repositoryItemTextEdit6,
            this.repositoryItemPopupContainerEdit1,
            this.repositoryItemGridLookUpEdit1,
            this.repositoryItemLookUpEdit2});
            // 
            // bar1
            // 
            this.bar1.BarName = "Custom 1";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = DevExpress.XtraBars.BarDockStyle.Top;
            this.bar1.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
            new DevExpress.XtraBars.LinkPersistInfo(this.ylcQheaGue),
            new DevExpress.XtraBars.LinkPersistInfo(this.btnJLLR),
            new DevExpress.XtraBars.LinkPersistInfo(this.btnJLSP),
            new DevExpress.XtraBars.LinkPersistInfo(this.btnBGL),
            new DevExpress.XtraBars.LinkPersistInfo(this.btnSJWH),
            new DevExpress.XtraBars.LinkPersistInfo(this.btnCTWH),
            new DevExpress.XtraBars.LinkPersistInfo(this.btnBBDY),
            new DevExpress.XtraBars.LinkPersistInfo(this.barStaticItem1, true),
            new DevExpress.XtraBars.LinkPersistInfo(DevExpress.XtraBars.BarLinkUserDefines.Width, this.edtBD, "", false, true, true, 278),
            new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem, true),
            new DevExpress.XtraBars.LinkPersistInfo(this.btnUser),
            new DevExpress.XtraBars.LinkPersistInfo(this.barButtonItem1, true),
            new DevExpress.XtraBars.LinkPersistInfo(this.barStaticItem5)});
            this.bar1.OptionsBar.AllowQuickCustomization = false;
            this.bar1.OptionsBar.RotateWhenVertical = false;
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Custom 1";
            // 
            // ylcQheaGue
            // 
            this.ylcQheaGue.Caption = "综合查询";
            this.ylcQheaGue.Id = 17;
            this.ylcQheaGue.Name = "ylcQheaGue";
            this.ylcQheaGue.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBBDY_ItemClick);
            // 
            // btnJLLR
            // 
            this.btnJLLR.Caption = "计量录入";
            this.btnJLLR.Id = 18;
            this.btnJLLR.Name = "btnJLLR";
            this.btnJLLR.PaintStyle = DevExpress.XtraBars.BarItemPaintStyle.CaptionGlyph;
            this.btnJLLR.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBBDY_ItemClick);
            // 
            // btnJLSP
            // 
            this.btnJLSP.Caption = "计量审批";
            this.btnJLSP.Id = 19;
            this.btnJLSP.Name = "btnJLSP";
            this.btnJLSP.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBBDY_ItemClick);
            // 
            // btnBGL
            // 
            this.btnBGL.Caption = "变更令";
            this.btnBGL.Id = 20;
            this.btnBGL.Name = "btnBGL";
            this.btnBGL.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            this.btnBGL.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBBDY_ItemClick);
            // 
            // btnSJWH
            // 
            this.btnSJWH.Caption = "数据维护";
            this.btnSJWH.Id = 21;
            this.btnSJWH.Name = "btnSJWH";
            this.btnSJWH.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBBDY_ItemClick);
            // 
            // btnCTWH
            // 
            this.btnCTWH.Caption = "草图维护";
            this.btnCTWH.Id = 22;
            this.btnCTWH.Name = "btnCTWH";
            this.btnCTWH.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBBDY_ItemClick);
            // 
            // btnBBDY
            // 
            this.btnBBDY.Caption = "报表打印";
            this.btnBBDY.Id = 23;
            this.btnBBDY.Name = "btnBBDY";
            this.btnBBDY.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBBDY_ItemClick);
            // 
            // barStaticItem1
            // 
            this.barStaticItem1.Caption = "标段";
            this.barStaticItem1.Id = 11;
            this.barStaticItem1.Name = "barStaticItem1";
            this.barStaticItem1.TextAlignment = System.Drawing.StringAlignment.Near;
            // 
            // edtBD
            // 
            this.edtBD.Caption = "ss";
            this.edtBD.Edit = this.repositoryItemLookUpEdit2;
            this.edtBD.Id = 12;
            this.edtBD.Name = "edtBD";
            this.edtBD.EditValueChanged += new System.EventHandler(this.edtBD_EditValueChanged);
            // 
            // repositoryItemLookUpEdit2
            // 
            this.repositoryItemLookUpEdit2.AutoHeight = false;
            this.repositoryItemLookUpEdit2.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.repositoryItemLookUpEdit2.Name = "repositoryItemLookUpEdit2";
            // 
            // barButtonItem
            // 
            this.barButtonItem.Caption = "清单打印";
            this.barButtonItem.Id = 7;
            this.barButtonItem.Name = "barButtonItem";
            this.barButtonItem.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            this.barButtonItem.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem_ItemClick);
            // 
            // btnUser
            // 
            this.btnUser.Caption = "用户管理";
            this.btnUser.Id = 9;
            this.btnUser.Name = "btnUser";
            this.btnUser.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            this.btnUser.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnUser_ItemClick);
            // 
            // barButtonItem1
            // 
            this.barButtonItem1.Caption = "重新登录";
            this.barButtonItem1.Id = 13;
            this.barButtonItem1.Name = "barButtonItem1";
            this.barButtonItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            this.barButtonItem1.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.barButtonItem1_ItemClick);
            // 
            // barStaticItem5
            // 
            this.barStaticItem5.Appearance.ForeColor = System.Drawing.Color.Red;
            this.barStaticItem5.Appearance.Options.UseForeColor = true;
            this.barStaticItem5.Id = 15;
            this.barStaticItem5.Name = "barStaticItem5";
            this.barStaticItem5.TextAlignment = System.Drawing.StringAlignment.Near;
            this.barStaticItem5.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
            // 
            // barDockControl
            // 
            this.barDockControl.Dock = System.Windows.Forms.DockStyle.Top;
            this.barDockControl.Location = new System.Drawing.Point(0, 0);
            this.barDockControl.Size = new System.Drawing.Size(1284, 26);
            // 
            // barDockControl1
            // 
            this.barDockControl1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.barDockControl1.Location = new System.Drawing.Point(0, 476);
            this.barDockControl1.Size = new System.Drawing.Size(1284, 0);
            // 
            // barDockControl2
            // 
            this.barDockControl2.Dock = System.Windows.Forms.DockStyle.Left;
            this.barDockControl2.Location = new System.Drawing.Point(0, 26);
            this.barDockControl2.Size = new System.Drawing.Size(0, 450);
            // 
            // barDockControl3
            // 
            this.barDockControl3.Dock = System.Windows.Forms.DockStyle.Right;
            this.barDockControl3.Location = new System.Drawing.Point(1284, 26);
            this.barDockControl3.Size = new System.Drawing.Size(0, 450);
            // 
            // barEditItem1
            // 
            this.barEditItem1.Caption = "建设单位";
            this.barEditItem1.Description = "建设单位";
            this.barEditItem1.Edit = this.repositoryItemTextEdit5;
            this.barEditItem1.Id = 0;
            this.barEditItem1.Name = "barEditItem1";
            // 
            // repositoryItemTextEdit5
            // 
            this.repositoryItemTextEdit5.AutoHeight = false;
            this.repositoryItemTextEdit5.Name = "repositoryItemTextEdit5";
            // 
            // btnExport
            // 
            this.btnExport.Caption = "数据导出";
            this.btnExport.Id = 6;
            this.btnExport.Name = "btnExport";
            this.btnExport.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnExport_ItemClick);
            // 
            // btnBGLXD
            // 
            this.btnBGLXD.Caption = "变更令下达";
            this.btnBGLXD.Id = 8;
            this.btnBGLXD.Name = "btnBGLXD";
            this.btnBGLXD.ItemClick += new DevExpress.XtraBars.ItemClickEventHandler(this.btnBGLXD_ItemClick);
            // 
            // barStaticItem4
            // 
            this.barStaticItem4.Caption = "barStaticItem4";
            this.barStaticItem4.Id = 14;
            this.barStaticItem4.Name = "barStaticItem4";
            this.barStaticItem4.TextAlignment = System.Drawing.StringAlignment.Near;
            // 
            // btnEditQc
            // 
            this.btnEditQc.Caption = "修改期次";
            this.btnEditQc.Id = 16;
            this.btnEditQc.Name = "btnEditQc";
            // 
            // repositoryItemTextEdit4
            // 
            this.repositoryItemTextEdit4.AutoHeight = false;
            this.repositoryItemTextEdit4.Name = "repositoryItemTextEdit4";
            this.repositoryItemTextEdit4.ReadOnly = true;
            // 
            // repositoryItemTextEdit6
            // 
            this.repositoryItemTextEdit6.AutoHeight = false;
            this.repositoryItemTextEdit6.Name = "repositoryItemTextEdit6";
            this.repositoryItemTextEdit6.ReadOnly = true;
            // 
            // repositoryItemPopupContainerEdit1
            // 
            this.repositoryItemPopupContainerEdit1.AutoHeight = false;
            this.repositoryItemPopupContainerEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.repositoryItemPopupContainerEdit1.Name = "repositoryItemPopupContainerEdit1";
            // 
            // repositoryItemGridLookUpEdit1
            // 
            this.repositoryItemGridLookUpEdit1.AutoHeight = false;
            this.repositoryItemGridLookUpEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.repositoryItemGridLookUpEdit1.Name = "repositoryItemGridLookUpEdit1";
            this.repositoryItemGridLookUpEdit1.View = this.repositoryItemGridLookUpEdit1View;
            // 
            // repositoryItemGridLookUpEdit1View
            // 
            this.repositoryItemGridLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            this.repositoryItemGridLookUpEdit1View.Name = "repositoryItemGridLookUpEdit1View";
            this.repositoryItemGridLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.repositoryItemGridLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            // 
            // tpJLLR
            // 
            this.tpJLLR.Name = "tpJLLR";
            this.tpJLLR.Size = new System.Drawing.Size(1277, 420);
            this.tpJLLR.Text = "计量录入";
            // 
            // tpZHCX
            // 
            this.tpZHCX.Name = "tpZHCX";
            this.tpZHCX.Size = new System.Drawing.Size(1277, 420);
            this.tpZHCX.Text = "综合查询";
            // 
            // tabControl
            // 
            this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tabControl.HeaderButtons = DevExpress.XtraTab.TabButtons.None;
            this.tabControl.Location = new System.Drawing.Point(0, 26);
            this.tabControl.Name = "tabControl";
            this.tabControl.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.tabControl.SelectedTabPage = this.tpCTWH;
            this.tabControl.Size = new System.Drawing.Size(1284, 450);
            this.tabControl.TabIndex = 25;
            this.tabControl.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] {
            this.tpZHCX,
            this.tpJLLR,
            this.tpJLSP,
            this.tpBGL,
            this.tpSJWH,
            this.tpCTWH,
            this.tpBBDY});
            this.tabControl.SelectedPageChanged += new DevExpress.XtraTab.TabPageChangedEventHandler(this.tabControl_SelectedPageChanged);
            this.tabControl.SelectedPageChanging += new DevExpress.XtraTab.TabPageChangingEventHandler(this.tabControl_SelectedPageChanging);
            // 
            // tpCTWH
            // 
            this.tpCTWH.Name = "tpCTWH";
            this.tpCTWH.Size = new System.Drawing.Size(1277, 420);
            this.tpCTWH.Text = "草图维护";
            // 
            // tpJLSP
            // 
            this.tpJLSP.Name = "tpJLSP";
            this.tpJLSP.Size = new System.Drawing.Size(1277, 420);
            this.tpJLSP.Text = "计量审批";
            // 
            // tpBGL
            // 
            this.tpBGL.Name = "tpBGL";
            this.tpBGL.Size = new System.Drawing.Size(1277, 420);
            this.tpBGL.Text = "变更令";
            // 
            // tpSJWH
            // 
            this.tpSJWH.Name = "tpSJWH";
            this.tpSJWH.Size = new System.Drawing.Size(1277, 420);
            this.tpSJWH.Text = "数据维护";
            // 
            // tpBBDY
            // 
            this.tpBBDY.Name = "tpBBDY";
            this.tpBBDY.Size = new System.Drawing.Size(1277, 420);
            this.tpBBDY.Text = "报表打印";
            // 
            // onypCxUys
            // 
            this.onypCxUys.Bars.AddRange(new DevExpress.XtraBars.Bar[] {
            this.bar});
            this.onypCxUys.DockControls.Add(this.barDockControl7);
            this.onypCxUys.DockControls.Add(this.barDockControl6);
            this.onypCxUys.DockControls.Add(this.barDockControl4);
            this.onypCxUys.DockControls.Add(this.barDockControl5);
            this.onypCxUys.Form = this;
            this.onypCxUys.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
            this.barStaticItem2,
            this.barStaticItem3,
            this.lblYZ,
            this.lblJL});
            this.onypCxUys.MaxItemId = 13;
            this.onypCxUys.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemTextEdit1,
            this.repositoryItemTextEdit2,
            this.repositoryItemTextEdit3,
            this.repositoryItemLookUpEdit1,
            this.repositoryItemTextEdit7,
            this.repositoryItemTextEdit8});
            this.onypCxUys.StatusBar = this.bar;
            // 
            // bar
            // 
            this.bar.BarName = "Status bar";
            this.bar.CanDockStyle = DevExpress.XtraBars.BarCanDockStyle.Bottom;
            this.bar.DockCol = 0;
            this.bar.DockRow = 0;
            this.bar.DockStyle = DevExpress.XtraBars.BarDockStyle.Bottom;
            this.bar.LinksPersistInfo.AddRange(new DevExpress.XtraBars.LinkPersistInfo[] {
            new DevExpress.XtraBars.LinkPersistInfo(this.barStaticItem2),
            new DevExpress.XtraBars.LinkPersistInfo(this.lblYZ),
            new DevExpress.XtraBars.LinkPersistInfo(this.barStaticItem3),
            new DevExpress.XtraBars.LinkPersistInfo(this.lblJL)});
            this.bar.OptionsBar.AllowQuickCustomization = false;
            this.bar.OptionsBar.DrawDragBorder = false;
            this.bar.OptionsBar.UseWholeRow = true;
            this.bar.Text = "Status bar";
            // 
            // barStaticItem2
            // 
            this.barStaticItem2.Caption = "总监办：";
            this.barStaticItem2.Id = 2;
            this.barStaticItem2.Name = "barStaticItem2";
            this.barStaticItem2.TextAlignment = System.Drawing.StringAlignment.Near;
            // 
            // lblYZ
            // 
            this.lblYZ.AutoSize = DevExpress.XtraBars.BarStaticItemSize.Spring;
            this.lblYZ.Id = 11;
            this.lblYZ.Name = "lblYZ";
            this.lblYZ.TextAlignment = System.Drawing.StringAlignment.Near;
            this.lblYZ.Width = 32;
            // 
            // barStaticItem3
            // 
            this.barStaticItem3.Caption = "监理：";
            this.barStaticItem3.Id = 4;
            this.barStaticItem3.Name = "barStaticItem3";
            this.barStaticItem3.TextAlignment = System.Drawing.StringAlignment.Near;
            // 
            // lblJL
            // 
            this.lblJL.AutoSize = DevExpress.XtraBars.BarStaticItemSize.Spring;
            this.lblJL.Id = 12;
            this.lblJL.Name = "lblJL";
            this.lblJL.TextAlignment = System.Drawing.StringAlignment.Near;
            this.lblJL.Width = 32;
            // 
            // barDockControl7
            // 
            this.barDockControl7.Dock = System.Windows.Forms.DockStyle.Top;
            this.barDockControl7.Location = new System.Drawing.Point(0, 0);
            this.barDockControl7.Size = new System.Drawing.Size(1284, 0);
            // 
            // barDockControl6
            // 
            this.barDockControl6.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.barDockControl6.Location = new System.Drawing.Point(0, 476);
            this.barDockControl6.Size = new System.Drawing.Size(1284, 30);
            // 
            // barDockControl4
            // 
            this.barDockControl4.Dock = System.Windows.Forms.DockStyle.Left;
            this.barDockControl4.Location = new System.Drawing.Point(0, 0);
            this.barDockControl4.Size = new System.Drawing.Size(0, 476);
            // 
            // barDockControl5
            // 
            this.barDockControl5.Dock = System.Windows.Forms.DockStyle.Right;
            this.barDockControl5.Location = new System.Drawing.Point(1284, 0);
            this.barDockControl5.Size = new System.Drawing.Size(0, 476);
            // 
            // repositoryItemTextEdit1
            // 
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.repositoryItemTextEdit1.ReadOnly = true;
            // 
            // repositoryItemTextEdit2
            // 
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.repositoryItemTextEdit2.ReadOnly = true;
            // 
            // repositoryItemTextEdit3
            // 
            this.repositoryItemTextEdit3.AutoHeight = false;
            this.repositoryItemTextEdit3.Name = "repositoryItemTextEdit3";
            this.repositoryItemTextEdit3.ReadOnly = true;
            // 
            // repositoryItemLookUpEdit1
            // 
            this.repositoryItemLookUpEdit1.AutoHeight = false;
            this.repositoryItemLookUpEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});
            this.repositoryItemLookUpEdit1.Name = "repositoryItemLookUpEdit1";
            // 
            // repositoryItemTextEdit7
            // 
            this.repositoryItemTextEdit7.AutoHeight = false;
            this.repositoryItemTextEdit7.Name = "repositoryItemTextEdit7";
            // 
            // repositoryItemTextEdit8
            // 
            this.repositoryItemTextEdit8.AppearanceReadOnly.BackColor = System.Drawing.Color.WhiteSmoke;
            this.repositoryItemTextEdit8.AppearanceReadOnly.Options.UseBackColor = true;
            this.repositoryItemTextEdit8.AutoHeight = false;
            this.repositoryItemTextEdit8.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
            this.repositoryItemTextEdit8.Name = "repositoryItemTextEdit8";
            this.repositoryItemTextEdit8.ReadOnly = true;
            // 
            // dataSet
            // 
            this.dataSet.DataSetName = "NewDataSet";
            // 
            // FrmMain
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1284, 506);
            this.Controls.Add(this.tabControl);
            this.Controls.Add(this.barDockControl2);
            this.Controls.Add(this.barDockControl3);
            this.Controls.Add(this.barDockControl1);
            this.Controls.Add(this.barDockControl);
            this.Controls.Add(this.barDockControl4);
            this.Controls.Add(this.barDockControl5);
            this.Controls.Add(this.barDockControl6);
            this.Controls.Add(this.barDockControl7);
            this.Name = "FrmMain";
            this.Text = "计量支付管理系统";
            this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmMain_FormClosing);
            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FrmMain_FormClosed);
            this.Load += new System.EventHandler(this.FrmMain_Load);
            ((System.ComponentModel.ISupportInitialize)(this.barManager)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemLookUpEdit2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit5)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit4)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit6)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemPopupContainerEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemGridLookUpEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemGridLookUpEdit1View)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.tabControl)).EndInit();
            this.tabControl.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.onypCxUys)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit3)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemLookUpEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit7)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemTextEdit8)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataSet)).EndInit();
            this.ResumeLayout(false);

        }

        private void method()
        {
            this.method16();
        }

        private void method1(XtraTabPage xtraTabPage, Form form)
        {
            if (xtraTabPage.Controls.Count == 0)
            {
                form.WindowState = FormWindowState.Normal;
                form.Dock = DockStyle.Fill;
                CHelp.ControlAddForm(xtraTabPage, form, true);
            }
        }

        private bool method10(Form form)
        {
            return (form.ShowDialog() == System.Windows.Forms.DialogResult.OK);
        }

        private void method11(BarItem barItem)
        {
            string name = barItem.Name;
            if (name.Equals(this.ylcQheaGue.Name))
            {
                this.tabControl.SelectedTabPage = this.tpZHCX;
            }
            else if (name.Equals(this.btnJLLR.Name))
            {
                this.tabControl.SelectedTabPage = this.tpJLLR;
            }
            else if (name.Equals(this.btnJLSP.Name))
            {
                this.tabControl.SelectedTabPage = this.tpJLSP;
            }
            else if (name.Equals(this.btnBGL.Name))
            {
                this.tabControl.SelectedTabPage = this.tpBGL;
            }
            else if (name.Equals(this.btnSJWH.Name))
            {
                this.tabControl.SelectedTabPage = this.tpSJWH;
            }
            else if (name.Equals(this.btnCTWH.Name))
            {
                this.tabControl.SelectedTabPage = this.tpCTWH;
            }
            else if (name.Equals(this.btnBBDY.Name))
            {
                this.tabControl.SelectedTabPage = this.tpBBDY;
            }
        }

        private void method12()
        {
            switch (GParams._JGLX)
            {
                case JGLX.YZ:
                    this.ylcQheaGue.Visibility = BarItemVisibility.Always;
                    this.btnJLLR.Visibility = BarItemVisibility.Never;
                    this.btnJLSP.Visibility = BarItemVisibility.Always;
                    this.btnBGL.Visibility = BarItemVisibility.Never;
                    this.btnSJWH.Visibility = BarItemVisibility.Never;
                    this.btnCTWH.Visibility = BarItemVisibility.Never;
                    this.btnBBDY.Visibility = BarItemVisibility.Always;
                    this.btnEditQc.Visibility = BarItemVisibility.Never;
                    this.tabControl.SelectedTabPageIndex = 0;
                    break;

                case JGLX.JL:
                    this.ylcQheaGue.Visibility = BarItemVisibility.Always;
                    this.btnJLLR.Visibility = BarItemVisibility.Never;
                    this.btnJLSP.Visibility = BarItemVisibility.Always;
                    this.btnBGL.Visibility = BarItemVisibility.Never;
                    this.btnSJWH.Visibility = BarItemVisibility.Never;
                    this.btnCTWH.Visibility = BarItemVisibility.Never;
                    this.btnBBDY.Visibility = BarItemVisibility.Always;
                    this.btnEditQc.Visibility = BarItemVisibility.Never;
                    this.btnBGLXD.Visibility = BarItemVisibility.Never;
                    this.tabControl.SelectedTabPageIndex = 0;
                    break;

                case JGLX.CBR:
                    this.ylcQheaGue.Visibility = BarItemVisibility.Always;
                    this.btnJLLR.Visibility = BarItemVisibility.Always;
                    this.btnJLSP.Visibility = BarItemVisibility.Never;
                    this.btnBGL.Visibility = BarItemVisibility.Never;
                    this.btnSJWH.Visibility = BarItemVisibility.Never;
                    this.btnCTWH.Visibility = BarItemVisibility.Never;
                    this.btnBBDY.Visibility = BarItemVisibility.Always;
                    this.btnEditQc.Visibility = BarItemVisibility.Always;
                    this.btnBGLXD.Visibility = BarItemVisibility.Never;
                    this.tabControl.SelectedTabPageIndex = 0;
                    break;

                case JGLX.GLY:
                    this.ylcQheaGue.Visibility = BarItemVisibility.Never;
                    this.btnJLLR.Visibility = BarItemVisibility.Never;
                    this.btnJLSP.Visibility = BarItemVisibility.Never;
                    this.btnBGL.Visibility = BarItemVisibility.Never;
                    this.btnSJWH.Visibility = BarItemVisibility.Always;
                    this.btnCTWH.Visibility = BarItemVisibility.Always;
                    this.btnBBDY.Visibility = BarItemVisibility.Never;
                    this.barStaticItem1.Visibility = BarItemVisibility.Never;
                    this.edtBD.Visibility = BarItemVisibility.Never;
                    this.bar.Visible = false;
                    this.btnEditQc.Visibility = BarItemVisibility.Never;
                    this.btnExport.Visibility = BarItemVisibility.Never;
                    this.btnBGLXD.Visibility = BarItemVisibility.Never;
                    this.barButtonItem.Visibility = BarItemVisibility.Never;
                    this.btnUser.Visibility = BarItemVisibility.Never;
                    this.tabControl.SelectedTabPageIndex = 4;
                    break;
            }
        }

        private void method13()
        {
            foreach (XtraTabPage page in this.tabControl.TabPages)
            {
                if ((page.Controls.Count > 0) && (page.Controls[0] is Form))
                {
                    (page.Controls[0] as Form).Close();
                }
            }
            if (this.tabControl.SelectedTabPageIndex != 0)
            {
                this.tabControl.SelectedTabPageIndex = 0;
            }
            else
            {
                this.method1(this.tabControl.SelectedTabPage, new FrmSearch());
            }
        }

        private void method14()
        {
            base.Hide();
            FrmLogin login = new FrmLogin();
            if (login.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
            {
                base.Close();
            }
            else
            {
                this.IniLogin();
                base.Show();
            }
        }

        private void method15(int numD)
        {
            if ((this.tabControl.SelectedTabPage.Controls.Count > 0) && (this.tabControl.SelectedTabPage.Controls[0] is Form))
            {
                Form form = this.tabControl.SelectedTabPage.Controls[0] as Form;
                Win32API.SendMessage(form.Handle, numD, 0, 0);
            }
        }

        private void method16()
        {
            this.method15(0x61);
        }

        private void method17()
        {
            this.method15(0x60);
        }

        private void method18()
        {
            if (GParams._JGLX.Equals(JGLX.CBR) && (DBHelp.GetDt("select * from DATAUPDATE", "DATAUPDATE").Rows.Count == 0))
            {
                try
                {
                    IDataAccess ida = DBHelp.IniIDA();
                    string format = "insert into DATAUPDATE (id,bdid,qcid) values('ImportGLYData','{0}',1);";
                    format = string.Format(format, GParams._BDID);
                    DBHelp.ExeSql(ida, format);
                }
                catch (Exception exception)
                {
                    MsgBox.ShowError("系统出错，请与管理员系统！", exception);
                }
            }
        }

        private void method19()
        {
            GParams._BDID = this.edtBD.EditValue.ToString();
            this.method8();
            this.method7();
            this.method6();
            this.method18();
            this.tabControl.SelectedTabPage = this.tpZHCX;
            this.method17();
        }

        private void method2(string _str, JGLX jglx)
        {
            if (!_str.Equals(GParams._BDID))
            {
                MsgBox.ShowMsg("当前选择的数据包不是当前标段的数据包，请修正后继续!");
            }
        }

        private bool method20(TabPageChangingEventArgs tabPageChangingEventArgs)
        {
            if ((GParams._QCData == null) || (GParams._QCData.Rows.Count == 0))
            {
                MsgBox.ShowMsg("还没有承包人数据，当前操作不可用");
                tabPageChangingEventArgs.Cancel = true;
                return false;
            }
            return true;
        }

        private bool method21(TabPageChangingEventArgs tabPageChangingEventArgs)
        {
            if (GParams._QCData.Rows.Count == 0)
            {
                FrmAddQc qc = new FrmAddQc();
                qc.IniQC(true);
                if (qc.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                {
                    tabPageChangingEventArgs.Cancel = true;
                }
            }
            return !tabPageChangingEventArgs.Cancel;
        }

        private void method22(object sender, NavBarLinkEventArgs e)
        {
            this.method3();
        }

        private void method23(object sender, ItemClickEventArgs e)
        {
            this.method16();
            this.method17();
        }

        private void method3()
        {
            if (GParams._JGLX.Equals(JGLX.GLY))
            {
                this.method10(new FrmDataXD());
            }
            else
            {
                using (FrmQCSelect select = new FrmQCSelect())
                {
                    if (select.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        string qCID = select.QCID;
                        Class37.smethod1().ExpDataByJGLX();
                    }
                }
            }
        }

        private void method4()
        {
            IExport export = Class37.smethod1();
            string text1 = this.lblYZ.Caption + "-" + this.edtBD.Edit.GetDisplayText(this.edtBD.EditValue);
            export.YZExpBGLData();
        }

        private bool method5()
        {
            if (Class37.smethod().imethod_2(SJLX.Non))
            {
                this.method13();
                this.method9();
                this.method6();
                return true;
            }
            return false;
        }

        private void method6()
        {
            DataSet dataSet = new DataSet();
            IDataAccess idataAccess = DBHelp.IniIDA();
            string str = "select * from XMQC" + Class28.smethod1() + " order by qcid";
            Class39.smethod4(idataAccess, dataSet, str, "XMQC", true);
            DataTable table = dataSet.Tables["XMQC"];
            DataRow[] rowArray = dataSet.Tables["XMQC"].Select("qcid=max(QCID)");
            if (rowArray.Length > 0)
            {
                QCInfo info = new QCInfo();
                info.QCID = rowArray[0]["qcid"].ToString();
                info.QCZT = CHelp.ConvertInt(rowArray[0]["zt"], 0);
                info.JSRQ = (DateTime) rowArray[0]["JSRQ"];
                GParams.QCInfo = info;
                GParams.MaxQcId = CHelp.ConvertInt(info.QCID, 0);
            }
            GParams._QCData = table;
        }

        private void method7()
        {
            string filterExpression = string.Format("id='{0}'", GParams._BDID);
            DataRow[] rows = this.dataTable.Select(filterExpression);
            if (rows.Length > 0)
            {
                filterExpression = string.Format("id='{0}'", DHelp.GetRowValue(rows, "pid", 0).ToString());
                DataRow[] rowArray2 = this.dataTable.Select(filterExpression);
                this.lblJL.Caption = DHelp.GetRowValue(rowArray2, "mcqc", 0).ToString();
            }
        }

        private void method8()
        {
            string filterExpression = string.Format("id='{0}'", GParams._BDID);
            DataRow[] rowArray = this.dataTable.Select(filterExpression);
            if (rowArray.Length > 0)
            {
                GParams._YJBFS = CHelp.ConvertInt(rowArray[0]["YJBFS"], 100);
                GParams._CLDFBL = CHelp.ConvertInt(rowArray[0]["CLDFBL"], 100);
                GParams._BDName = this.edtBD.Edit.GetDisplayText(this.edtBD.EditValue);
            }
        }

        private void method9()
        {
            if (!GParams._JGLX.Equals(JGLX.GLY))
            {
                DataSet dataSet = new DataSet();
                IDataAccess idataAccess = DBHelp.IniIDA();
                string str = string.Empty;
                string str2 = "";
                str = "select a.*,b.htdwmc,a.mc + case when isnull(b.htdwmc)=1 then '' else '【' + b.htdwmc + '】' end as mcqc,b.YJBFS,b.CLDFBL from zzjgxx a left join zzjgxxex b on a.id=b.id ";
                Class39.smethod4(idataAccess, dataSet, str, "zzjgxx", true);
                this.dataTable = dataSet.Tables["zzjgxx"];
                if (this.dataTable.Rows.Count > 0)
                {
                    string filterExpression = "";
                    filterExpression = string.Format("id='{0}'", GParams.LoginId);
                    DataRow[] rows = this.dataTable.Select(filterExpression);
                    if (rows.Length > 0)
                    {
                        str2 = DHelp.GetRowValue(rows, "xmid", 0).ToString();
                        GParams._XMID = str2;
                        GParams._str = DHelp.GetRowValue(rows, "mcqc", 0).ToString();
                        GParams.LevelCode = DHelp.GetRowValue(rows, "LevelCode", 0).ToString();
                        RepositoryItemLookUpEdit properties = (RepositoryItemLookUpEdit) this.edtBD.Edit;
                        DataRow[] rowArray2 = this.dataTable.Select(string.Format("LevelCode like '{0}%' and JGLX=2 and xmid='{1}'", GParams.LevelCode, str2));
                        GParams._BDID = DevCCHelp.SetLookUpList(properties, rowArray2, "ID", "mcqc");
                        this.edtBD.EditValue = GParams._BDID;
                        this.method8();
                        filterExpression = string.Format("len(levelCode)=3 and xmid='{0}'", str2);
                        DataRow[] rowArray3 = this.dataTable.Select(filterExpression);
                        if (rowArray3.Length > 0)
                        {
                            DataRow row = rowArray3[0];
                            this.lblYZ.Caption = row["mcqc"].ToString();
                            GParams._YZID = row["id"].ToString();
                        }
                        GParams.DZYZ = GParams._YZID == GParams.LoginId;
                        this.method7();
                        str = string.Format("select * from xmjbxxex where id='{0}'", str2);
                        Class39.smethod4(idataAccess, dataSet, str, "xmjbxxex", true);
                        str = string.Format("select * from xmjbxx where id='{0}'", str2);
                        Class39.smethod4(idataAccess, dataSet, str, "xmjbxx", true);
                        str = "select a.*,b.htdwmc, a.mc + case when isnull(b.htdwmc)=1 then '' else '-' + b.htdwmc end as mcqc from zzjgxx a left join zzjgxxex b on a.id=b.id where a.id='" + GParams.LoginId + "'";
                        Class39.smethod4(idataAccess, dataSet, str, "dqzzjgxx", true);
                        string str4 = " 【项目名称: " + DHelp.GetFieldValue(dataSet.Tables["xmjbxx"], "XMMC", 0) + "】 【建设单位: " + DHelp.GetFieldValue(dataSet.Tables["xmjbxxex"], "XMJSDW", 0) + "】 【当前操作用户: " + DHelp.GetFieldValue(dataSet.Tables["dqzzjgxx"], "mcqc", 0) + " " + GParams._USERNAME + "】";
                        this.Text = "项目管理软件    " + str4;
                        this.barStaticItem5.Visibility = BarItemVisibility.Never;
                    }
                }
                idataAccess.CloseDatabase();
            }
            else
            {
                this.bar.Visible = false;
            }
        }

        private void tabControl_SelectedPageChanged(object sender, TabPageChangedEventArgs e)
        {
            XtraTabPage selectedTabPage = this.tabControl.SelectedTabPage;
            if (selectedTabPage.Controls.Count == 0)
            {
                switch (this.tabControl.SelectedTabPageIndex)
                {
                    case 0:
                        this.method1(selectedTabPage, new FrmSearch());
                        break;

                    case 1:
                        this.method1(selectedTabPage, new FrmZJJL());
                        break;

                    case 2:
                        this.method1(selectedTabPage, new FrmSPGL());
                        break;

                    case 3:
                        this.method1(selectedTabPage, new FrmBGL());
                        break;

                    case 4:
                        this.method1(selectedTabPage, new FrmGLYSZ());
                        break;

                    case 5:
                        this.method1(selectedTabPage, new FrmCT());
                        break;

                    case 6:
                    {
                        FrmJLRep form = new FrmJLRep();
                        this.method1(selectedTabPage, form);
                        break;
                    }
                }
            }
            else
            {
                this.method17();
            }
        }

        private void tabControl_SelectedPageChanging(object sender, TabPageChangingEventArgs e)
        {
            if (!GParams._JGLX.Equals(JGLX.GLY))
            {
                this.method16();
                switch (e.Page.TabIndex)
                {
                    case 1:
                        if (!GParams._JGLX.Equals(JGLX.CBR))
                        {
                            this.method20(e);
                            break;
                        }
                        this.method21(e);
                        break;

                    case 2:
                        if (!GParams._JGLX.Equals(JGLX.CBR))
                        {
                            this.method20(e);
                            break;
                        }
                        this.method21(e);
                        break;

                    case 6:
                        if (!GParams._JGLX.Equals(JGLX.CBR))
                        {
                            this.method20(e);
                            break;
                        }
                        this.method21(e);
                        break;
                }
            }
        }
    }
}

